﻿IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JPushMessageLog]') AND type in (N'U'))
DROP TABLE [dbo].[JPushMessageLog]
GO

CREATE TABLE [dbo].[JPushMessageLog](
    [Key] [uniqueidentifier] NOT NULL DEFAULT NEWID(),
    [MessageId] [int] NOT NULL DEFAULT 0,
    [ReceiverValue] [nvarchar](max) NULL,
    [Content] [nvarchar](max) NOT NULL,
    [Platform] [int] NOT NULL DEFAULT 0,
    [CustomizedValue] [xml] NULL,
    [MessageType] [int] NOT NULL DEFAULT 0,
    [PushType] [int] NOT NULL DEFAULT 0,
    [ResponseCode] [INT] NOT NULL DEFAULT 0,
    [ResponseMessage] [nvarchar](max) NULL,
    [PushTitle] [nvarchar](max) NULL,
    [BuilderId] [nvarchar](max) NULL,
    [AndroidDeliveredCount] [int] NULL,
    [ApplePushNotificationDeliveredCount] [int] NULL,
    [IsTest] [BIT] NOT NULL DEFAULT 0,
    [CreatedStamp] [datetime] NOT NULL DEFAULT GETUTCDATE(),
    [LastUpdatedStamp] [datetime] NOT NULL DEFAULT GETUTCDATE()
CONSTRAINT [PK_JPushMessageLog] PRIMARY KEY CLUSTERED 
(
    [Key] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

